package com.k.kpp.web.easyexcel2.domain;

import java.util.Arrays;
import java.util.Optional;

public enum ExcelTypeEnum {
    ARRIVEPOINT("arrivePoint_excel","arrivePoint",ArrivePointExcel.class)
    ;

    private String value;
    private String name;
    private final Class<?> modelClass;

    ExcelTypeEnum(String value, String name,Class<?> cls) {
        this.value = value;
        this.name = name;
        this.modelClass = cls;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Class<?> getModelClass() {
        return modelClass;
    }

    public static Optional<ExcelTypeEnum> matchOpValue(String v) {
        return Arrays.stream(ExcelTypeEnum.values()).filter(a -> a.value.equals(v)).findFirst();
    }


}
